package ambika.polymorphism;


public class PolymorphExample {

	public static int area = 0;
	public static int calculateArea(int l, int w){
		area = l *w;
		return area;
	}
	
	public static int calculateArea(double b, double h){
		area = (int) (0.5 * b *h);
		return area;
	}
	
	public static int calculateArea(double b1, int b2, double h){
		area = (int) (((b1+b2)/2)* h);
		return area;
	}
	
	public static void main(String[] args){
		System.out.println("The area of a rectangle is "+calculateArea(7,5));
		System.out.println("The area of a triangle is "+calculateArea(7,5));
		System.out.println("The area of a trapezoid is "+calculateArea(7,5,8));
	}
}
